package l.l.w.CodingInterviews.jingdong;

import java.util.Scanner;

/**
 * Created by llw on 2018/4/9/0009.
 */
public class Two {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        long[] result = new long[2];
        for(int i = 0; i < t; ++i){
            long N = scanner.nextLong();
            boolean isSuc = getResult(N, result);
            if(isSuc){
                System.out.println(result[0] + " " + result[1]);
            }else{
                System.out.println("No");
            }
        }
    }

    private static boolean getResult(long n, long[] result) {
        if((n & 1) == 1){//奇数
            return false;
        }
        long temp = n;
        long time = 1;
        while(temp > 0 && (temp & 1) == 0){
            temp = temp >> 1;
            time <<= 1;
        }
        if(temp == 0) return false;
        result[0] = temp;
        result[1] = time;
        return true;
    }
}
